<template>
  <div>
    <input type="text" v-model="username" />
  </div>
</template>

<script>
export default {
  data() {
    return {
      username: "",
    };
  },
  // 拿到input变化,
  watch: {
    username(newVal, oldVal) {
      console.log(newVal, oldVal);
    },
  },
};
</script>

<style>
</style>